//
//  XS_Base.swift
//  Pods
//
//  Created by 韩云智 on 2020/7/15.
//

import Toast_Swift

public enum XS_Type {
    public static let channel = "App Store"
    
    public static let api = ""
    public static let api_h5 = ""
    public static let api_download = ""
    
    /// 极光推送
    public static let jPush_appKey = ""
    public static let jPush_channel = "Publish channel"
    public static let isProduction = true
    
    /// 微信
    public static let wx_appId = "wx98abf815efe04690"
    public static let wx_appSecret = "3cc96f624711e61cea2564e32dceb7e0"
    public static let wx_universalLink = "https://xdapi.yaoxuedao.com.cn/"
    
    /// QQ
    public static let qq_appId = ""
    public static let qq_appKey = ""
    
    /// 文件地址
    public static let topicFilePath = NSHomeDirectory() + "/Library/Caches/topic"
    public static let audioPath = "/desc/audio"
    public static let imgPath = "/desc/img"
}


public enum XS_ActionType {
    case `default`
    case cancel
    case sure
    
    case play
    case previous
    case next
    case again
    
    case detail
}

public extension UIView {
    public func xsShowMsg(_ message: String?, duration: TimeInterval = ToastManager.shared.duration, position: ToastPosition = ToastManager.shared.position, title: String? = nil, image: UIImage? = nil, style: ToastStyle = ToastManager.shared.style, completion: ((_ didTap: Bool) -> Void)? = nil) {
        guard let message = message, message.count > 0 else { return }
        hideToast()
        makeToast(message, duration: duration, position: position, title: title, image: image, style: style, completion: completion)
    }
}

public class XS_NoHighlightBtn: UIButton {
    public override var isHighlighted: Bool {
        set {}
        get { false }
    }
}
